home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_slashweb_talk.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  91 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_Slashweb_talk.cog
  4. #
  5. # Damage a face with Machete to allow move through. 
  6. # Added Indy sayline for bumping into .[SXC & DS]
  7. # Removed flying leaves previously added to slashvine_talk.
  8. #
  9. # [TRM & SXC & DS]
  10. #
  11. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16.     message        damaged
  17.     message        touched
  18.  
  19.     sound        touchvines
  20.  
  21.     surface        vines            mask=0x408
  22.     surface        vinesback        mask=0x408
  23.  
  24.     thing        player            local
  25.  
  26.     int            tutch=0            local
  27.     int            direction=0        local
  28.     int            facedir=0        desc=0-north, 1-south, 2-east, 3-west
  29.  
  30.     flex        playerx=0        local
  31.     flex        playery=0        local
  32.  
  33.     vector        playervec        local
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40.  
  41. damaged:
  42.  
  43.     # See if damage is from machete -- RT
  44.     if (GetParam(1) == 0x20)
  45.     {
  46.         SetWallCel(vines, 1);
  47.         SetWallCel(vinesback, 1);
  48.         ClearAdjoinFlags(vines, 0x10);
  49.         SetAdjoinFlags(vinesback, 0x2);
  50.         tutch = 1;
  51.     }
  52.     return;
  53.  
  54. # ========================================================================================
  55.  
  56. touched:
  57.  
  58.     if (tutch == 1) return;
  59.  
  60.     player = GetLocalPlayerThing();
  61.  
  62.     playervec = GetThingLVec(player);
  63.     playery = VectorY(playervec);
  64.     playerx = VectorX(playervec);
  65.  
  66.     if ((playery > 0) && ((playerx > -0.7) && (playerx < 0.7)))
  67.     {
  68.         direction = 0;    # North
  69.     }
  70.     else if ((playery < 0) && ((playerx > -0.7) && (playerx < 0.7)))
  71.     {
  72.         direction = 1;    # South
  73.     }
  74.     else if ((playerx > 0) && ((playery > -0.7) && (playery < 0.7)))
  75.     {
  76.         direction = 2;    # East
  77.     }
  78.     else if ((playerx < 0) && ((playery > -0.7) && (playery < 0.7)))
  79.     {
  80.         direction = 3;    # West
  81.     }
  82.  
  83.     if (direction == facedir)
  84.     {
  85.         PlayVoice(player, touchvines, 1.0, 0);
  86.         tutch = 1;
  87.     }
  88.     return;
  89.  
  90. end
  91.